<template>
	<view class="mine_box">
		<!-- <view class="person_box dis_fx fx_column fx_between">
			<view class="dis_fx fx_column">
				<image src=""></image>
				<view class="text">
					<view class="name">1111</view>
					<view class="member dis_fx fx_column fx_center">
						<text>普通用户</text>
					</view>
				</view>
			</view>
			<navigator class="invite_btn" url="../invite/invite">邀请好友</navigator>
		</view> -->
		<view class="person_box dis_fx fx_column fx_between">
			<view class="dis_fx fx_column">
				<image  :src="userInfo.tokenInfo.headImg"></image>
				<view class="text">
					<view class="name">{{userInfo.tokenInfo.nickName}}</view>
					<view class="member dis_fx fx_column fx_center">
						<text  v-if="userInfo.tokenInfo.vipLevel=='0' ||userInfo.tokenInfo.vipLevel==null ">普通用户</text>
						<text  v-if="userInfo.tokenInfo.vipLevel=='1' || userInfo.tokenInfo.vipLevel=='2' || userInfo.tokenInfo.vipLevel=='3'">乐兔会员</text>
						<view v-if="userInfo.tokenInfo.vipLevel=='1'" class="num">T1</view>
						<view v-if="userInfo.tokenInfo.vipLevel=='2'" class="num">T2</view>
						<view v-if="userInfo.tokenInfo.vipLevel=='3'" class="num">T3</view>
					</view>
				</view>
			</view>
			<!-- <navigator class="invite_btn" url="../invite/invite">加入会员</navigator> -->
			<navigator class="invite_btn" url="../accept/accept">邀请好友</navigator>
		</view>
		<view class="wddd_block bg_f">
			<view class="block_tit dis_fx fx_column fx_between"><text class="fw600">我的订单</text><navigator url="/pages/order/myOrder/myOrder" class="more dis_fx fx_column"><text>全部订单</text><view class="icon"></view></navigator></view>
			<view class="wddd_con dis_fx fx_center">
				<navigator url="/pages/order/myOrder/myOrder?status=TP" class="item dis_fx fx_column flex1">
					<image src="../../static/dai%20zhi%20fu_icon.png"></image>
					<text>待支付</text>
				</navigator>
				<navigator url="/pages/order/myOrder/myOrder?status=TA" class="item dis_fx fx_column flex1">
					<image src="../../static/pin%20tuan%20zhong_icon.png"></image>
					<text>拼团中</text>
				</navigator>
				<navigator url="/pages/order/myOrder/myOrder?status=TR" class="item dis_fx fx_column flex1">
					<image src="../../static/dai%20chu%20xing_icon.png"></image>
					<text>待出行</text>
				</navigator>
			</view>
		</view>
		<view class="block_box">
			<view class="wdsy_block bg_f">
				<view class="block_tit dis_fx fx_column fx_between"><text class="fw600">我的收益</text></view>
				<view class="wdsy_con dis_fx fx_center">
					<view class="item dis_fx fx_column flex1" @click="toNewPage('/pages/order/revenueStreams/revenueStreams')">
						<view class="price">￥{{userInfo.userblacne.unsettled}}</view>
						<text>待收益</text>
					</view>
					<view class="item dis_fx fx_column flex1" @click="toNewPage('/pages/myWallet/myWallet')">
						<view class="price">￥{{userInfo.userblacne.available}}</view>
						<text>可提现</text>
					</view>
					<view class="item dis_fx fx_column flex1" @click="toNewPage('/pages/order/cashFlow/cashFlow')">
						<view class="price">￥{{userInfo.userblacne.withdrawal}}</view>
						<text>已提现</text>
					</view>
				</view>
			</view>
			<view class="wdtd_block bg_f">
				<view class="block_tit dis_fx fx_column fx_between"><text class="fw600">我的团队</text></view>
				<view class="wdtd_con dis_fx fx_center">
					<navigator url="/pages/order/directlyUnder/directlyUnder" class="item item1 dis_fx fx_column flex1">
						<image src="../../static/zhi%20shu_icon.png"></image>
						<text>直属</text>
					</navigator>
					<navigator url="/pages/order/secondlevel/secondlevel" class="item item2 dis_fx fx_column flex1" >
						<image src="../../static/er%20ji_icon.png"></image>
						<text>二级</text>
					</navigator>
					<navigator url="" class="item item3 dis_fx fx_column flex1" v-if="userType==1">
						<image src="../../static/er%20wei%20ma_icon.png"></image>
						<text>二维码</text>
					</navigator>
				</view>
			</view>
			<view class="wdtd_block bg_f">
				<view class="block_tit dis_fx fx_column fx_between"><text class="fw600">我的团队</text></view>
				<view class="wdtd_con dis_fx fx_center">
					<navigator url="/pages/myWallet/myWallet" class="item item4 dis_fx fx_column flex1">
						<image src="../../static/wo%20de%20qian%20bao_icon.png"></image>
						<text>我的钱包</text>
					</navigator>
					<navigator url="/pages/travellingPeople/travellingPeople" class="item item5 dis_fx fx_column flex1">
						<image src="../../static/chu%20xing%20ren_icon.png"></image>
						<text>出行人</text>
					</navigator>
					<navigator class="item item5 dis_fx fx_column flex1">
					</navigator>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import util from '../../common/util.js'
	export default {
		data() {
			return {
				userInfo:{},
				userType:0
			}
		},
		onLoad(option){
			
		},
		onShow(){
			this.getProductDetail()
		},
		methods: {
			toNewPage (url){
				uni.navigateTo({
					url
				})
			},
			//获取用户信息
			getProductDetail () {
				uni.showLoading({
					mask:true,
					title: '加载中'
				});
				var _self = this
				util.fetchPost('/userCenter/init',{},function(res){
					console.log(res)
					_self.userInfo = res.data
					_self.userType=res.data.tokenInfo.userType;
					uni.hideLoading();
				},function(){},true)
			},
			
		}
	}
</script>

<style>
	.invite_btn{
		font-size: 32upx;
		color: #545454;
		width: 200upx;
		padding: 15upx 0;
		text-align: center;
		border: 4upx solid #fff;
		border-radius: 10upx;
		background: #FFC801;
	}
	.block_tit{
		font-size: 32upx;
		color: #333333;
		margin-bottom: 30upx;
	}
	.block_tit .more text{
		font-size: 24upx;
		color: #999999;
		margin-right: 10upx;
	}
	.block_tit .more .icon{
		background: url() no-repeat center/contain;
		width: 10upx;
		height: 20upx;
	}
	.mine_box{
		padding-bottom: 100upx;
	}
	.mine_box .person_box{
		padding: 40upx 24upx 0;
		background: url() no-repeat center/cover;
		width: 100%;
		height: 400upx;
	}
	.mine_box .person_box image{
		width: 120upx;
		height: 120upx;
		border-radius: 50%;
		border: 6upx solid #FFF7D5;
		box-shadow: 0 0 12upx 0 #DF7900;
		margin-right: 29upx;
	}
	.mine_box .person_box .name{
		font-size: 36upx;
		color: #333333;
		font-weight: 600;
		margin-bottom: 20upx;
	}
	.mine_box .person_box .member{
		background: #FFF5C5;
		width: 160upx;
		height: 40upx;
		border-radius: 20upx;
	}
	.mine_box .person_box .member text{
		font-size: 22upx;
		color: #757575;
	}
	.mine_box .person_box .member .num{
		font-size: 24upx;
		color: #FC5C1D;
		font-weight: 600;
		font-style: italic;
	}
	.wddd_block{
		padding: 30upx 24upx;
		width: 702upx;
		border-radius: 10upx;
		margin: -80upx auto 10upx;
		box-shadow: 0 0 18upx 0 rgba(106, 79, 13, 0.12);
	}
	.wddd_block .wddd_con{
		padding-top: 20upx;
		border-top: 1px solid #EAEAEA
	}
	.wddd_block .wddd_con .item,.wdsy_block .wdsy_con .item,.wdtd_block .wdtd_con .item{
		flex-direction: column;
	}
	.wddd_block .wddd_con .item image{
		width: 68upx;
		height: 68upx;
	}
	.wddd_block .wddd_con .item text,.wdtd_block .wdtd_con .item text{
		font-size: 28upx;
		color: #757575;
		margin-top: 10upx;
	}
	.mine_box .block_box{
		padding: 0 24upx;
	}
	.wdsy_block,.wdtd_block{
		padding: 30upx 24upx;
		border-bottom: 1px solid #EAEAEA;
	}
	.wdsy_block .wdsy_con .item .price{
		font-size: 32upx;
		color: #FC5C1D;
		margin-bottom: 5upx;
	}
	.wdsy_block .wdsy_con .item text{
		font-size: 28upx;
		color: #757575;
	}
	.wdtd_block .wdtd_con .item.item1 image{
		width: 42upx;
		height: 50upx;
	}
	.wdtd_block .wdtd_con .item.item2 image,.wdtd_block .wdtd_con .item.item5 image{
		width: 45upx;
		height: 50upx;
	}
	.wdtd_block .wdtd_con .item.item3 image,.wdtd_block .wdtd_con .item.item4 image{
		width: 50upx;
		height: 50upx;
	}
</style>
